import re
import emoji

_PATTERN_WHITESPACE = re.compile(r'\s+')


def remove_whitespace(s: str) -> str:
    '''
    移除空白字符
    :param s: 待操作字符串
    '''
    return _PATTERN_WHITESPACE.sub('', s)


_PATTERN_ANTI_WHITESPACE = re.compile(r':\S+?:')


def remove_emoji(s: str) -> str:
    '''
    移除emoji表情
    '''
    return _PATTERN_ANTI_WHITESPACE.sub('', emoji.demojize(s))
